package com.example.cunwan_hd;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.beans.BeanWrapper;
import org.springframework.beans.BeanWrapperImpl;
import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.stereotype.Component;

import com.example.cunwan_hd.Server.WebSocket;

@Component
public class PaasContext implements ApplicationContextAware {
    private static ApplicationContext applicationContext;

    @Override
    public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
        PaasContext.applicationContext = applicationContext;
    }

    public static <T> T getBean(Class<T> clazz) {
        return PaasContext.applicationContext.getBean(clazz);
    }


    public static Object getBean(String beanName) {
        return PaasContext.applicationContext.getBean(beanName);
    }

}
